﻿using UnityEngine;
using UnityEngine.UI;

namespace Example_0000_Atlas_03
{
	public class UIMain : MonoBehaviour {

		void Start () 
		{
			GameObject button = GameObject.Instantiate(Resources.Load<GameObject>("Example_0001_deep/button"))as GameObject;
			button.transform.parent = transform;
			button.transform.localPosition = Vector3.zero;
			button.transform.localScale = Vector3.one;
	
			GameObject AObj = transform.Find("MainA").gameObject;
	
			GameObject BObj = transform.Find("MainB").gameObject;
	
			button.transform.SetSiblingIndex(AObj.transform.GetSiblingIndex());
	
		}
	}
}

